package cz.proks.easyhelpdesk.gae.api.impl.db;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;

import cz.proks.easyhelpdesk.api.EmailApi;
import cz.proks.easyhelpdesk.api.config.Configuration;
import cz.proks.easyhelpdesk.api.model.Email;

@Repository(Configuration.DB.EMAIL_API)
@Scope("prototype")
public class EmailApiImpl extends BaseHelpdeskApiImpl<Email> implements EmailApi {
	private final Logger log = LoggerFactory.getLogger(getClass());
		
	@Override
	protected Class<Email> getDomainClass() {
		return Email.class;
	}

    @Override
    protected Email getDboObject(Email entity) {
        cz.proks.easyhelpdesk.gae.api.impl.dbo.Email dbo = instantiateDbo(entity);
        
        if (dbo != null)
            dbo.toDbo(entity);
        
        return dbo;
    }		
	
}
